<template>
  <input :type="type" :placeholder="placeholder" v-model="value" @blur="getval"/>
</template>

<script>
export default {
    name:'input',
    data(){
        return{
            value:''
        }
    },
    props:{
        type:{
            type:String,
            default:'text'
        },
        placeholder:{
            type:String,
            default:'请输入您的愿望'           
        }
    },
    methods:{
        getval(){
            this.$emit('content',this.value)
            this.$store.commit('changeCont',this.value)
            this.value=''
        }
    }
}
</script>

<style lang="scss" scoped>
input{
    width: 80%;
    margin: 10px auto;
    height: 40px;
    font-size: 20px;
    text-indent: 1em;
    border: 2px solid red;
}
</style>